#ifndef SCANNERHELPER_H
#define SCANNERHELPER_H
#include <vector>
#include <cctype>
namespace tinyscript{
namespace internal{

class StringBufferHelper{
public:
    StringBufferHelper( const std::vector<char_t>& buf ):
        buffer_(buf){}

    char_t CharAt( size_t index ) const {
        return buffer_.size() <= index ? 0 : buffer_[index];
    }

	const std::vector<char_t>& buffer() const {
		return buffer_;
	}

private:
    const std::vector<char_t>& buffer_;
};


inline bool IsValidSymbolInitialChar( char_t c ) {
    return c == '_' || isalpha(c);
}

inline bool IsValidSymbolRestChar( char_t c ) {
    return c == '_' || isalpha(c) || isdigit(c);
}


}
}

#endif // SCANNERHELPER_H
